<?php

class Albun extends AppModel {
    public $name = 'Albun';
	public $useTable = false; 
	
	
	public function findAll(){
		$albunes = array();
		$dir = 'img/albunes';
		if (is_dir($dir)) {
			if ($gd = opendir($dir)) {
				while ($file = readdir($gd)) {
					if ($this->esAlbun($file)) {
						$albunes[] = array('albun' => array('nombre' => $file));
					}
				}
				closedir($gd);
			}
		}
		return $albunes;
	}
	
	function esAlbun($file) {
       return ($file != "." && $file != ".." && $file != ".svn");
	   
	} 
}